<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserScoreRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_score_record', function (Blueprint $table) {
            $table->increments('id');
            $table->string("order_sn",50)->comment("订单号");
            $table->integer("user_id")->comment("用户ID");
            $table->integer("next_user_id")->default(0)->comment("下级用户ID，0为不存在");
            $table->integer("type")->default("1")->comment("积分类型:1充值,2分享,3赠送");
            $table->decimal("score",10,2)->default(0)->comment("积分");
            $table->string("remark",255)->nullable()->comment("变更说明");
            $table->integer("status")->default(2)->comment("审核状态:2待审核，1已通过");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_score_record');
    }
}
